﻿@model FrogFoot.Entities.Order

<h3>User Actions</h3>
<hr />
<div class="row form-group">
    <table class="table table-striped table-responsive">
        <thead>
            <tr>
                <th>Action</th>
                <th>Order Status</th>
                <th>Name</th>
                <th>Email</th>
                <th>Timestamp</th>
                <th>Message</th>
            </tr>
        </thead>
        <tbody id="logTableRows">
            @foreach (var log in Model.Logs)
            {
                <tr>
                    <td>@log.Type.ToString()</td>
                    <td>@log.OrderStatus.ToString()</td>
                    <td>@(log.User != null ? log.User.FirstName + " " + log.User.LastName : "" )</td>
                    <td>@(log.User != null ? log.User.Email : "")</td>
                    <td>@(log.TimeStamp != null ? @log.TimeStamp.Value.ToString("f") : "")</td>
                    <td>@log.Message</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="row">
    <div class="form-group">
        <label>Message</label>
        <textarea id="orderMessage" class="form-control" rows="3" cols="50"></textarea>
    </div>
    <div class="form-group">
        <button id="saveMessage" class="btn btn-primary">Save Message</button>
    </div>
    <div id="saveMessageSuccessResult" class="alert alert-success" style="display: none;">
        Message saved
    </div>
</div>